<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<%@include file="/include/public.jspf"%>
<% 
	String path = request.getContextPath();
%>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no">
<script type="text/javascript" src="${path }/js/jquery1.10.2.min.js"></script>
<script type="text/javascript" src="${path }/js/helper.js"></script>
<!-- <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script> -->
 <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script> 
<link type="text/css" href="<%=path %>/page/shareredpacket/css/css.css" rel="stylesheet" />
<title>分享红包返利</title>
<script type="text/javascript">
	 wx.config({
	   debug:  false,  //调式模式，设置为ture后会直接在网页上弹出调试信息，用于排查问题
	   appId: '${appId}',
	   timestamp: ${timestamp},
	   nonceStr: '${nonceStr}',
	   signature: '${signature}',
	   jsApiList: [  //需要使用的网页服务接口
	       'checkJsApi',  //判断当前客户端版本是否支持指定JS接口
	       'onMenuShareTimeline', //分享给好友
	       'onMenuShareAppMessage', //分享到朋友圈
	       'onMenuShareQQ',  //分享到QQ
	       'onMenuShareWeibo', //分享到微博
	       'showAllNonBaseMenuItem'
	   ]
	 });
	 
	 wx.ready(function () {   //ready函数用于调用API，如果你的网页在加载后就需要自定义分享和回调功能，需要在此调用分享函数。//如果是微信游戏结束后，需要点击按钮触发得到分值后分享，这里就不需要调用API了，可以在按钮上绑定事件直接调用。因此，微信游戏由于大多需要用户先触发获取分值，此处请不要填写如下所示的分享API
    	 // 1 监听“分享给朋友”，按钮点击、自定义分享内容及分享结果接口
   	     wx.onMenuShareAppMessage({
		      title: '红包红包真可爱，又能生钱又有爱',
		      desc: '分享好友莫等待，一起来看“红包雨”！',
		      link: '${h5domain}/activityCore/toGetRedPacket.htm?hostRedPacketId=${redPacket.id}',
		      imgUrl: '${h5domain}/images/tzhb.jpg',
		      success: function (res) {
		        alert('已分享');
		        window.location.href="${path }/redpacket/redlist.htm?type=2";
		      },
		      cancel: function (res) {
		        alert('已取消');
		      }, 
		      fail: function (res) {
		        alert(JSON.stringify(res));
		      }
		    });
   	    
        //2 监听“分享到朋友圈”按钮点击、自定义分享内容及分享结果接口
   	    wx.onMenuShareTimeline({
   	      title: '红包红包真可爱，又能生钱又有爱',
   	      link: '${h5domain}/activityCore/toGetRedPacket.htm?hostRedPacketId=${redPacket.id}',
   	      imgUrl: '${h5domain}/images/tzhb.jpg',
   	      success: function (res) {
   	    	  alert('已分享');
		      window.location.href="${path }/redpacket/redlist.htm?type=2";
   	      },
   	   		cancel: function (res) {
	        alert('已取消');
	      },
   	      fail: function (res) {
   	        alert(JSON.stringify(res));
   	      }
   	    });
   	 	wx.showAllNonBaseMenuItem();
    });
    
    wx.error(function (res) {
    	 alert(res.errMsg);  //打印错误消息。及把 debug:false,设置为debug:ture就可以直接在网页上看到弹出的错误提示
     });
    
    
</script>
</head>
<body>
<form id="myform" action="<%=path%>/activityCore/doGetRedPacket.htm">
	
	<div class="topbg">
	    		<div class="money">￥${redPacket.money/100 }</div>
	    		<div id="share_do" style="display:block;">
			    	<div class="shouji_int"></div>
			    	<a class="now_lq" href="javascript:void(0);" onclick="dosubmit()">马上领取</a>
			    	<div class="t_c"></div>
			    	<a class="now_dl" href="#">下载魔环金融客户端</a>
			    </div>
	</div>
</form>
<div class=" Position_relative">
  <div class="Position_absolute_no hdgz"><span><i></i>活动规则</span></div>
</div>
<div class="hd_cont">
<p>1.下载魔环金融APP，用手机号码注册且将账户与手机号码绑定。</p>
<p>2.使用红包的下单手机号需与领取红包的手机号一致。</p>
<p>3.最终活动解释权归魔环金融所有。</p>
</div>
<div class="clearfix"></div>

<div style="height:80px;"></div>
<div class="mask"><a class="dl_app_bt r" href="#">下载客户端</a></div>

<!-- 分享功能  -->
<div class="mask_fx">
	<img src="${path }/page/shareredpacket/images/guide1.png" />
</div>
</body>
</html>
